package com.pzr.soccer.controller;

import com.pzr.soccer.dao.GameRepository;
import com.pzr.soccer.domain.game.GameWrapper;
import com.pzr.soccer.service.GameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author pzr
 * @date:2021-12-15-18:10
 * @Description:
 **/
@RestController
@RequestMapping("/game")
public class GameController {
    @Autowired
    GameService service;
    @Autowired
    GameRepository repository;
    @GetMapping("/todayOnGoing")
    public List<GameWrapper>  todayOnGoing(){
        return repository.findOnGoingGamesInRedis();
    }
    @GetMapping("/todayComing")
    public List<GameWrapper>  todayComing(){
        return repository.findComingGamesInRedis();
    }
    @GetMapping("/todayEnded")
    public List<GameWrapper>  todayEnded(){
        return repository.findEndedGamesInRedis();
    }
}
